package com.demo.design.behavioral.observer;

import com.demo.design.behavioral.observer.impl.DartzonOberver;
import com.demo.design.behavioral.observer.impl.ElectricChargeSubject;
import com.demo.design.behavioral.observer.impl.LowanObserver;
import com.demo.design.behavioral.observer.impl.WaterRateSubject;

public class ObserverMain {

    public static void main(String[] args) {
        Observer lowan = new LowanObserver();
        Observer dartzon = new DartzonOberver();

        TargetSubject meter = new ElectricChargeSubject();
        meter.addObserver(lowan);
        meter.addObserver(dartzon);
        meter.notifyObservers();

        System.err.println();

        TargetSubject water = new WaterRateSubject();
        water.addObserver(lowan);
        water.addObserver(dartzon);
        water.notifyObservers();


    }

}
